// return 0 if no joy, anything else if joy
uint8_t checkJoystick(void);

volatile char joystickInput;
volatile char joystickChanged;

// declare global variables
volatile char joystickKey;
volatile char joystickKeyValid;
//volatile char ENABLED;

#define KEY_UP      0
#define KEY_DOWN    1
#define KEY_LEFT    2
#define KEY_RIGHT   3
#define KEY_PUSH    4
#define KEY_INVALID 5

#define BUTTON_A    6   // UP
#define BUTTON_B    7   // DOWN
#define BUTTON_C    2   // LEFT
#define BUTTON_D    3   // RIGHT
#define BUTTON_O    4   // PUSH

//#define PINB_MASK ((1<<PINB4)|(1<<PINB6)|(1<<PINB7))
//#define PINE_MASK ((1<<PINE2)|(1<<PINE3))

//#define PCINTB_MASK ((1<<PCINT12)|(1<<PCINT14)|(1<<PCINT15))
//#define PCINTE_MASK ((1<<PCINT2)|(1<<PCINT3))

#define TRUE 1
#define FALSE 0

// declare functions
void pinChangeInterrupt(void);
//char getkey(void);

void initializer(void);
void parseInput(char *);
//void joystick(void);

void initJoystick(void);
